﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;

namespace MvcControlsToolkit.Examples.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to ASP.NET MVC!";

            return View();
        }

        public ActionResult DialogAjaxView()
        {
            Thread.Sleep(3000);
            return View();
        }

        public ActionResult TabAjaxView()
        {
            Thread.Sleep(5000);
            return View();
        }

        [HttpPost]
        public JsonResult Source(string term)
        {
            var result = new [] {"abc", "cfd", "fgr"};
            return Json(result);
        }        
    }
}
